home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / c / c_count-.0 / c_count- / c_count-7.0 / configure.in < prev    next >
Encoding:
Text File  |  1995-05-21  |  1.6 KB  |  69 lines

  1. dnl Process this file with 'autoconf' to produce a 'configure' script
  2. dnl $Id: configure.in,v 7.5 1995/05/21 22:43:38 tom Exp $
  3. AC_REVISION($Revision: 7.5 $)
  4. AC_INIT(c_count.c)
  5. AC_PROG_CC
  6. AC_PROG_INSTALL
  7. AC_GCC_TRADITIONAL
  8. AC_PROG_MAKE_SET
  9.  
  10. ###    use option -with-warnings to turn on all gcc warnings
  11. if test -n "$GCC"
  12. then
  13. AC_ARG_WITH(warnings,
  14. [  --with-warnings         use gcc warnings (used for developing this tool)],
  15. [CFLAGS="$CFLAGS -Wall -Wshadow -Wconversion -Wstrict-prototypes -Wmissing-prototypes"])
  16. fi
  17.  
  18. AC_SUBST(CFLAGS)
  19. AC_SUBST(LIBS)
  20.  
  21. AC_CONST
  22. AC_STDC_HEADERS
  23. AC_HAVE_HEADERS(stdlib.h getopt.h string.h malloc.h)
  24. AC_HAVE_FUNCS(strchr getopt)
  25.  
  26. ###
  27. AC_MSG_CHECKING(if compiler supports prototypes)
  28. AC_CACHE_VAL(td_cv_ansi_protos,[
  29.     AC_TRY_COMPILE([],
  30.         [extern foo(char a,int b); foo(1,2)],
  31.         [td_cv_ansi_protos=yes],
  32.         [td_cv_ansi_protos=no])])
  33. AC_MSG_RESULT($td_cv_ansi_protos)
  34. test $td_cv_ansi_protos = yes && AC_DEFINE(ANSI_PROTOS)
  35.  
  36. ###
  37. AC_MSG_CHECKING(if getopt is declared)
  38. AC_CACHE_VAL(td_cv_decl_getopt,[
  39.     AC_TRY_COMPILE([
  40. #include "system.h"
  41. #if HAVE_STDLIB_H
  42. #include <stdlib.h>
  43. #endif
  44. #if HAVE_GETOPT_H
  45. #include <getopt.h>
  46. #endif
  47. ],
  48.         [extern    void getopt();],
  49.         [td_cv_decl_getopt=no],
  50.         [td_cv_decl_getopt=yes])])
  51. AC_MSG_RESULT($td_cv_decl_getopt)
  52. test $td_cv_decl_getopt = yes && AC_DEFINE(DECLARED_GETOPT)
  53.  
  54. ###    output makefile and config.h
  55. changequote({,})dnl
  56. AC_OUTPUT(makefile config_h,
  57. {
  58. echo creating config.h
  59. sed    -e '/^# /d' \
  60.     -e 's/ -D/\
  61. #define /g' \
  62.     -e 's/\(#define [A-Za-z_][A-Za-z0-9_]*\)=/\1    /g' \
  63.     config_h >config.h
  64. }
  65. echo removing config_h
  66. rm config_h
  67. )
  68. changequote([,])dnl
  69.